// custom-tab-bar/index.js
Component({
  /**
   * 组件的初始数据
   */
  data: {
    selected:0,
    selectedColor: "#3cc51f",
    "list": [{
        "pagePath": "pages/index/index",
        "text": "首页",
        "iconPath": "icon/_home.png",
        "selectedIconPath": "icon/home.png"
      },
      {
        "pagePath": "pages/image/image",
        "text": "图片",
        "iconPath": "icon/_img.png",
        "selectedIconPath": "icon/img.png"
      },
      {
        "pagePath": "pages/my/my",
        "text": "我的",
        "iconPath": "icon/_my.png",
        "selectedIconPath": "icon/my.png"
      },
      {
        "pagePath": "pages/search/search",
        "text": "搜索",
        "iconPath": "icon/_search.png",
        "selectedIconPath": "icon/search.png"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    goToHome() {
      wx.switchTab({
        url: '/pages/index/index',
      })
    },
    goToImage() {
      wx.switchTab({
        url: '/pages/image/image',
      })
    },
    goToMine() {
      wx.switchTab({
        url: '/pages/my/my',
      })
    },
    goToSearch() {
      wx.switchTab({
        url: '/pages/search/search',
      })
    }
  }
})